home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / bbs / pad321.zip / STRIPCHA.MH < prev    next >
Text File  |  1996-08-21  |  519b  |  21 lines

  1. #ifndef __STRIPCHA_MH
  2. #define __STRIPCHA_MH
  3.  
  4. // stripChar removes all occourances of a particular character from a string.
  5. // The original string is modified.
  6.  
  7. void stripChar (Ref string: theString, char: stripChar) {
  8.   int: sidx, tidx;
  9.  
  10.   tidx := 1;
  11.   for (sidx := 1; sidx <= strlen (theString); sidx := sidx + 1) {
  12.     if (theString [sidx] <> stripChar) {
  13.       theString [tidx] := theString [sidx];
  14.       tidx := tidx + 1;
  15.       };
  16.     };
  17.   theString := substr (theString,1,tidx-1);
  18.   }
  19.  
  20. #endif
  21.